package sy.model;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * TsupplierInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tsupplier_info", catalog = "trade")
@DynamicUpdate(true)
@DynamicInsert(true)
public class TsupplierInfo implements java.io.Serializable
{
    
    // Fields    
    
    private String supplierid;
    
    private String contact;
    
    private Date createtime;
    
    private String enaddr;
    
    private String fax;
    
    private String linkman;
    
    private String suppliercode;
    
    private String supplierenname;
    
    private String supplierzhname;
    
    private String zhaddr;
    
    private Set<TsupplierTvehicle> tsupplierTvehicles = new HashSet<TsupplierTvehicle>(0);
    
    // Constructors
    
    /** default constructor */
    public TsupplierInfo()
    {
    }
    
    /** minimal constructor */
    public TsupplierInfo(String supplierid, String contact, String linkman, String suppliercode, String supplierzhname,
        String zhaddr)
    {
        this.supplierid = supplierid;
        this.contact = contact;
        this.linkman = linkman;
        this.suppliercode = suppliercode;
        this.supplierzhname = supplierzhname;
        this.zhaddr = zhaddr;
    }
    
    /** full constructor */
    public TsupplierInfo(String supplierid, String contact, Date createtime, String enaddr, String fax,
        String linkman, String suppliercode, String supplierenname, String supplierzhname, String zhaddr,
        Set<TsupplierTvehicle> tsupplierTvehicles)
    {
        this.supplierid = supplierid;
        this.contact = contact;
        this.createtime = createtime;
        this.enaddr = enaddr;
        this.fax = fax;
        this.linkman = linkman;
        this.suppliercode = suppliercode;
        this.supplierenname = supplierenname;
        this.supplierzhname = supplierzhname;
        this.zhaddr = zhaddr;
        this.tsupplierTvehicles = tsupplierTvehicles;
    }
    
    // Property accessors
    @Id
    @Column(name = "supplierid", unique = true, nullable = false)
    public String getSupplierid()
    {
        return this.supplierid;
    }
    
    public void setSupplierid(String supplierid)
    {
        this.supplierid = supplierid;
    }
    
    @Column(name = "contact", nullable = false)
    public String getContact()
    {
        return this.contact;
    }
    
    public void setContact(String contact)
    {
        this.contact = contact;
    }
    
    @Column(name = "createtime", length = 19)
    public Date getCreatetime()
    {
        return this.createtime;
    }
    
    public void setCreatetime(Date date)
    {
        this.createtime = date;
    }
    
    @Column(name = "enaddr")
    public String getEnaddr()
    {
        return this.enaddr;
    }
    
    public void setEnaddr(String enaddr)
    {
        this.enaddr = enaddr;
    }
    
    @Column(name = "fax")
    public String getFax()
    {
        return this.fax;
    }
    
    public void setFax(String fax)
    {
        this.fax = fax;
    }
    
    @Column(name = "linkman", nullable = false)
    public String getLinkman()
    {
        return this.linkman;
    }
    
    public void setLinkman(String linkman)
    {
        this.linkman = linkman;
    }
    
    @Column(name = "suppliercode", nullable = false)
    public String getSuppliercode()
    {
        return this.suppliercode;
    }
    
    public void setSuppliercode(String suppliercode)
    {
        this.suppliercode = suppliercode;
    }
    
    @Column(name = "supplierenname")
    public String getSupplierenname()
    {
        return this.supplierenname;
    }
    
    public void setSupplierenname(String supplierenname)
    {
        this.supplierenname = supplierenname;
    }
    
    @Column(name = "supplierzhname", nullable = false)
    public String getSupplierzhname()
    {
        return this.supplierzhname;
    }
    
    public void setSupplierzhname(String supplierzhname)
    {
        this.supplierzhname = supplierzhname;
    }
    
    @Column(name = "zhaddr", nullable = false)
    public String getZhaddr()
    {
        return this.zhaddr;
    }
    
    public void setZhaddr(String zhaddr)
    {
        this.zhaddr = zhaddr;
    }
    
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tsupplier")
    public Set<TsupplierTvehicle> getTsupplierTvehicles()
    {
        return this.tsupplierTvehicles;
    }
    
    public void setTsupplierTvehicles(Set<TsupplierTvehicle> tsupplierTvehicles)
    {
        this.tsupplierTvehicles = tsupplierTvehicles;
    }
    
}